<template>
  <div class="container">
    <div>
      <JsonExcel
        :data="json_data"
        :fields="json_fields"
        worksheet="My Worksheet"
        name="养护.xls"
      />
    </div>
  </div>
</template>

<script>
import JsonExcel from "vue-json-excel";
export default {
  components: {
    JsonExcel,
  },
  data() {
    return {
      json_fields: {
        街道: "deptName",
        巡视: "xs",
        浇水: "js",
        施肥: "sf",
        修剪: "xj",
        打药: "dy",
        更换: "gh",
        复壮: "fz",
      },
      json_data: [
          { deptName:'aa街道',xsNum:1,xs:1,js:2,sf:3,xj:4,dy:5,gh:6,fz:7 },
          { deptName:'bb街道',xsNum:7,xs:6,js:5,sf:4,xj:3,dy:2,gh:1,fz:1 },
          { deptName:'cc街道',xsNum:1,xs:1,js:2,sf:3,xj:4,dy:5,gh:6,fz:7 },
          { deptName:'dd街道',xsNum:7,xs:6,js:5,sf:4,xj:3,dy:2,gh:1,fz:1 },
          { deptName:'ee街道',xsNum:1,xs:1,js:2,sf:3,xj:4,dy:5,gh:6,fz:7 }
      ],
      json_meta: [
        [
          {
            key: "charset",
            value: "utf-8",
          },
        ],
      ],
    };
  },

  created() {},

  methods: {},
};
</script>

<style scoped lang='less'>
.container {
}
</style>
